package cn.jiyun;

import com.arcsoft.face.FaceEngine;
import com.arcsoft.face.enums.ErrorInfo;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

import java.io.File;

@SpringBootApplication
@MapperScan("cn.jiyun.mapper")
public class LoginApp {
    public static void main(String[] args) {
        //填自己的AppID和SDKkey
        String appId = "8vnBDxDnNoieXFv9gXrBN1umwzNEEBFovNAzheF9WfNm";
        String sdkKey = "zf8kAGPVL5qV6UJtwjGvXk3K1p5h5TwBWhjxLUAUGLF";

        String relativePath = "ruoyi-modules/fase/lib/WIN64";

        // 将相对路径转换为绝对路径
        File libDir = new File(relativePath).getAbsoluteFile();
        // 现在你可以创建FaceEngine对象，使用绝对路径来加载库文件
        FaceEngine faceEngine = new FaceEngine(libDir.getPath());
        //激活引擎
        int activeCode = faceEngine.activeOnline(appId, sdkKey);


        if (activeCode != ErrorInfo.MOK.getValue() && activeCode != ErrorInfo.MERR_ASF_ALREADY_ACTIVATED.getValue()) {
            System.out.println("引擎激活失败");
        }else {
            System.out.println("引擎激活成功");
        }
        SpringApplication.run(LoginApp.class, args);
    }
}
